import request from '@/utils/request'

/** ==================
 *      1. 配置管理相关
 * ===================
 */

/**
 * 获取库存列表
*/
export const getGoodsShelfList = (params) => {
  return request({
    url: '/sys/goods/listAll',
    method: 'get',
    params
  })
}

/**
 * 上传商品
*/
export const addGoods = (data) => {
  return request({
    url: `/sys/goods/save`,
    method: 'post',
    data
  })
}

/**
 * 获取等级列表
 */

export const getGoodsRankList = (data) => {
  return request({
    url: '/sys/goodsRank/list',
    method: 'get',
    data
  })
}

export const getGoodsInfoById = (id) => {
  return request({
    url: `sys/goods/info/${id}`,
    method: 'get'
  })
}

export const updateStatus = (data) => {
  return request({
    url: `sys/goods/update`,
    method: 'put',
    data
  })
}

/**
 * 新增商品链接
*/
export const addGoodsLink = (data) => {
  return request({
    url: `/api/shortChain/createShortChain`,
    method: 'post',
    data
  })
}
/**
 * 获得推广位id
 */

export const getAviliablePid = (params) => {
  return request({
    url: `/api/pid/getAviliablePid`,
    method: 'get',
    params
  })
}

